home *** CD-ROM | disk | FTP | other *** search
- using System;
- using System.Drawing;
- using System.IO;
- using System.Reflection;
- using System.Resources;
- using System.Runtime.InteropServices;
- using System.Windows.Forms;
- using DesktopSidebar;
-
-
- namespace NotesEditor
- {
- public class Plugin :
- IPlugin,
- IPanelCreator
- {
- public Plugin()
- {
- }
-
- public void Unload()
- {
- }
-
- public void OnPluginLoaded(string plugin)
- {
- }
-
- public void Load(
- out string author,
- out string authorEMail,
- out string description,
- out string homepage,
- int sidebarBuild,
- Sidebar Sidebar,
- IXmlNode pluginConfig,
- int pluginCookie)
- {
- author = "yyy based on DS SDK Sticker Panel";
- authorEMail = "";
- description = "Notes Editor";
- homepage = "";
-
- ImageList imageList= new ImageList();
-
- Icon ico1 = null;
- Icon ico2 = null;
-
- try
- {
- Assembly thisExe;
- thisExe = Assembly.GetExecutingAssembly();
-
- string[] resnames = thisExe.GetManifestResourceNames();
-
- Stream str1 = thisExe.GetManifestResourceStream("Icon.ico");
- ico1 = new Icon(str1, 16, 16);
- str1.Close();
- imageList.Images.Add(ico1);
-
- Stream str2 = thisExe.GetManifestResourceStream("Plugin.ico");
- ico2 = new Icon(str2, 16, 16);
- str2.Close();
- imageList.Images.Add(ico2);
- }
- catch(Exception e)
- {
- MessageBox.Show(e.Message, "NotesEditor");
- }
-
- Sidebar.RegisterPanel(
- "NotesEditor",
- "Notes Editor",
- "Notes Editor",
- (int)imageList.Handle,
- "0",
- "Accessories",
- "1",
- "",
- "",
- pluginCookie);
-
- imageList.Dispose();
-
- if (ico1 != null)
- ico1.Dispose();
- if (ico2 != null)
- ico2.Dispose();
- }
-
- private void InitializeComponent()
- {
- //
- // Plugin
- //
-
- }
-
- public void CreatePanel(ref IPanel panel, string panelClass)
- {
- if (panelClass=="NotesEditor")
- {
- panel=new NotesEditor.Panel();
- }
- }
- }
- }
-